package com.malljelly.study.controller;

import com.alibaba.fastjson.JSONObject;
import com.malljelly.study.feign.UnionpayFeignClient;
import com.malljelly.study.vo.unionpay.service.UnionPaymentInfoRequestVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 骑着蜗牛去旅行 on 2018/8/15.
 */

@RestController
@RequestMapping("unionpay")
public class ApiUnionpayController {

    @Autowired
    private UnionpayFeignClient unionpayFeignClient;

    @ApiOperation(value = "创建支付请求token", response = UnionPaymentInfoRequestVo.class)
    @PostMapping("/addPayInfoToken")
    public JSONObject addPayInfoToken(@RequestBody UnionPaymentInfoRequestVo paymentInfo){
       return  unionpayFeignClient.addPayInfoToken(paymentInfo);
    }
}
